import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:yi_shop/utils/colors.dart';
import 'package:yi_shop/utils/styles.dart';
import 'package:yi_shop/utils/svg.dart';
import 'package:yi_shop/utils/tools.dart';

class MineSettingIdentificationController extends GetxController {}

class MineSettingIdentificationPage extends GetView<MineSettingIdentificationController> {
  const MineSettingIdentificationPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        leading: ToolsUtils.builderLeading(),
        title: const Text(
          '实名认证',
        ),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              padding: const EdgeInsets.symmetric(vertical: 25),
              child: Text(
                '请拍摄您的中国第二代居民身份证原件',
                style: StylesUtils.customTextStyle(
                    color: ColorsUtils.color3333, fontSize: StylesUtils.fontSize16),
              ),
            ),
            Center(
              child: Container(
                alignment: Alignment.center,
                constraints: const BoxConstraints.expand(width: 275, height: 175),
                decoration: BoxDecoration(
                    image: DecorationImage(
                        image: ToolsUtils.assetImage('u14382.png'), fit: BoxFit.fill)),
                child: InkWell(
                  onTap: () {
                    ToolsUtils.photograph(context, callback: (XFile? file) {});
                  },
                  child: CircleAvatar(
                    backgroundColor: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF26f),
                    radius: 40,
                    child: Column(
                      children: [
                        Container(
                          margin: const EdgeInsets.only(top: 10),
                          alignment: Alignment.center,
                          child: SvgUtils.assetName('u14386', width: 25, height: 22),
                        ),
                        Container(
                          margin: const EdgeInsets.only(top: 5),
                          alignment: Alignment.center,
                          child: Text(
                            '拍摄',
                            style: StylesUtils.customTextStyle(),
                          ),
                        )
                      ],
                    ),
                  ),
                ),
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: 10, bottom: 30),
              alignment: Alignment.center,
              child: Text(
                '身份证正面照',
                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
              ),
            ),
            Center(
              child: Container(
                alignment: Alignment.center,
                constraints: const BoxConstraints.expand(width: 275, height: 175),
                decoration: BoxDecoration(
                    image: DecorationImage(
                        image: ToolsUtils.assetImage('u14382.png'), fit: BoxFit.fill)),
                child: InkWell(
                  onTap: () {
                    ToolsUtils.photograph(context, callback: (XFile? file) {});
                  },
                  child: CircleAvatar(
                    backgroundColor: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF26f),
                    radius: 40,
                    child: Column(
                      children: [
                        Container(
                          margin: const EdgeInsets.only(top: 10),
                          alignment: Alignment.center,
                          child: SvgUtils.assetName('u14386', width: 25, height: 22),
                        ),
                        Container(
                          margin: const EdgeInsets.only(top: 5),
                          alignment: Alignment.center,
                          child: Text(
                            '拍摄',
                            style: StylesUtils.customTextStyle(),
                          ),
                        )
                      ],
                    ),
                  ),
                ),
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: 10, bottom: 30),
              alignment: Alignment.center,
              child: Text(
                '身份证反面照',
                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
              ),
            ),
            Center(
              child: TextButton(
                  onPressed: () {},
                  style: ButtonStyle(
                      fixedSize: const MaterialStatePropertyAll(Size(300, 40)),
                      minimumSize: const MaterialStatePropertyAll(Size(300, 40)),
                      padding: const MaterialStatePropertyAll(EdgeInsets.zero),
                      alignment: Alignment.center,
                      backgroundColor: MaterialStatePropertyAll(
                          ColorsUtils.parseColorFromHexString(ColorsUtils.colorF048)),
                      shape: MaterialStatePropertyAll(
                          RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)))),
                  child: Text(
                    '提交审核',
                    style: StylesUtils.customTextStyle(fontSize: StylesUtils.fontSize16),
                  )),
            )
          ],
        ),
      ),
    );
  }
}
